home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / MISC / DSP4TEST.ZIP / TST4.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-02-15  |  816 b   |  57 lines

  1. ; Generate constant quadrature (IQ) sinewave (1.81 kHz) on left and right channels
  2.  
  3.     nolist
  4.     include 'leonid'
  5.     list
  6.  
  7.  
  8. buflen    equ    32
  9. f    equ    500
  10. fs    equ    8000
  11.  
  12.     org    p:user_code
  13.  
  14.     move            #buffer+2,r7
  15.     move            #buflen*4-1,m7
  16.  
  17.     move            #buffer,r2
  18.     move            #4-1,n2
  19.     move            #buflen*4-1,m2
  20.  
  21.     ctrlcd    1,r2,buflen,LINEI,0.0,0.0,LINEO|HEADP,0.0,0.0
  22.     move            (r2)+
  23.     opencd    fs/1000
  24.  
  25. ; wait for one sample
  26. loop    waitblk r2,buflen,1
  27.  
  28. ; then generate the sinewave
  29.     move            #0.3,x1
  30.  
  31.     move            x:<t1,x0
  32.     mpy    x0,x1,a     x:<t2,y0
  33.     sub    y0,a        x0,x:<t2
  34.     move            a,x:<t1
  35.  
  36. ; and output the generated samples
  37.     move            x0,y:(r2)+
  38.     move            a,y:(r2)+n2
  39.  
  40.     jmp    <loop
  41.  
  42.  
  43.     org    x:user_data
  44.  
  45. t1    dc    0.9
  46. t2    dc    0.0
  47.  
  48. buffer    dsm    buflen*4
  49.  
  50.  
  51.     org    y:user_data
  52.  
  53.     dsm    buflen*4
  54.  
  55.  
  56.     end
  57.